package zust.javaee.entity;

import javax.persistence.*;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by liy on 2016/12/18.
 */
@Entity
@Table(name = "tcorporation")
public class Tcorporation {

    private Integer id;
    private String name;
    private Tplayer tplayer;
    private Tmember principal;  //负责人
    private Short type;  //社团类型
    private String tutor;  //导师
    private String motto;  //社团座右铭
    private String purpose;  //宗旨
    private String introduction;  //社团介绍
    private String tel;
    private String email;
    private String address;
    private String remark;
    private Date createTime;
    private Short status;
    private Integer members;
    private String logo;
    private String pic;

    private Set<Tmember> tmembers = new HashSet<Tmember>(0);
    private Set<Tactivity> tactivities = new HashSet<Tactivity>(0);
    private Set<Tannouncement> tannouncements = new HashSet<Tannouncement>(0);
    private Set<Texperience> texperiences = new HashSet<Texperience>(0);
    private Set<TrequisitionForm> trequisitionForms = new HashSet<TrequisitionForm>(0);
    private Set<TsignupActivityForm> tsignupActivityForms = new HashSet<TsignupActivityForm>(0);

    public Tcorporation() {
    }

    @Id
    @GeneratedValue
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "player_id")
    public Tplayer getTplayer() {
        return tplayer;
    }

    public void setTplayer(Tplayer tplayer) {
        this.tplayer = tplayer;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "principal_id")
    public Tmember getPrincipal() {
        return principal;
    }

    public void setPrincipal(Tmember principal) {
        this.principal = principal;
    }

    @Column(name = "type")
    public Short getType() {
        return type;
    }

    public void setType(Short type) {
        this.type = type;
    }

    @Column(name = "tutor")
    public String getTutor() {
        return tutor;
    }

    public void setTutor(String tutor) {
        this.tutor = tutor;
    }

    @Column(name = "motto")
    public String getMotto() {
        return motto;
    }

    public void setMotto(String motto) {
        this.motto = motto;
    }

    @Column(name = "purpose")
    public String getPurpose() {
        return purpose;
    }

    public void setPurpose(String purpose) {
        this.purpose = purpose;
    }

    @Column(name = "introduction")
    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    @Column(name = "tel")
    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    @Column(name = "email")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Column(name = "address")
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "status")
    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }

    @Column(name = "members")
    public Integer getMembers() {
        return members;
    }

    public void setMembers(Integer members) {
        this.members = members;
    }

    @Column(name = "logo")
    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }


    @Column(name = "pic")
    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tcorporation")
    public Set<Tmember> getTmembers() {
        return tmembers;
    }

    public void setTmembers(Set<Tmember> tmembers) {
        this.tmembers = tmembers;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tcorporation")
    public Set<Tactivity> getTactivities() {
        return tactivities;
    }

    public void setTactivities(Set<Tactivity> tactivities) {
        this.tactivities = tactivities;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tcorporation")
    public Set<Tannouncement> getTannouncements() {
        return tannouncements;
    }

    public void setTannouncements(Set<Tannouncement> tannouncements) {
        this.tannouncements = tannouncements;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tcorporation")
    public Set<Texperience> getTexperiences() {
        return texperiences;
    }

    public void setTexperiences(Set<Texperience> texperiences) {
        this.texperiences = texperiences;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tcorporation")
    public Set<TrequisitionForm> getTrequisitionForms() {
        return trequisitionForms;
    }

    public void setTrequisitionForms(Set<TrequisitionForm> trequisitionForms) {
        this.trequisitionForms = trequisitionForms;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tcorporation")
    public Set<TsignupActivityForm> getTsignupActivityForms() {
        return tsignupActivityForms;
    }

    public void setTsignupActivityForms(Set<TsignupActivityForm> tsignupActivityForms) {
        this.tsignupActivityForms = tsignupActivityForms;
    }
}
